// Composables
import { createRouter, createWebHistory } from "vue-router";
import layout from "../layouts/index.vue";
const routes = [
  {
    path: "/",
    name: "home",
    component: import("@/layouts/index.vue"),
    redirect: "/home",
    children: [
      {
        path: "home",
        name: "center",
        component: import("@/views/Center.vue"),
        meta: {
          menuName: "个人中心",
          icon: "mdi-account",
        },
      },
      {
        path: "test",
        name: "test",
        meta: {
          menuName: "home",
          icon: "mdi-home-account",
        },
        children: [
          {
            path: "test2",
            name: "test2",
            meta: {
              menuName: "test2",
              icon: "mdi-account-cowboy-hat",
            },
            component: import("@/components/test2.vue"),
          },
          {
            path: "test1",
            name: "test1",
            meta: {
              menuName: "test1",
              icon: "mdi-car-lifted-pickup",
            },
            component: import("@/components/Test.vue"),
          },
          {
            path: "dragByCss",
            name: "DragByCss",
            meta: {
              menuName: "dragByCss",
              icon: "mdi-selection-drag",
            },
            component: import("@/components/DragByCss.vue"),
          }
        ],
      },
    ],
  },
  {
    path: "/*",
    name: "404",
    component: import("@/views/Login.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
